package de.jmda.gen.java.impl;

import de.jmda.gen.LineIndenter;
import de.jmda.gen.java.DeclaredMethodGenerator;
import de.jmda.gen.java.ParameterGenerator;

public class MainMethodGenerator
    extends DefaultStaticMethodDeclarationGenerator
{
	public MainMethodGenerator(String methodBody)
	{
		super();

		DeclaredMethodGenerator dmg = getDeclaredMethodGenerator();

		dmg.demandModifiersGenerator().setPublic(true);
		dmg.getTypeNameGenerator().setTypeName(Void.TYPE.getName());
		dmg.getMethodNameGenerator().setMethodName("main");

		ParameterGenerator pg = new DefaultParameterGenerator("String[]", "args");

		dmg.add(pg);

		dmg.setMethodBody(methodBody);
		dmg.setLineIndenter(new LineIndenter("\t", 1));
	}
}